@import '~choerodon-ui/lib/style/themes/default';

@success: #00bfa5;
@running: #4d90fe;
@pending: #ffb100;
@failed: #f77a70;
@canceled: #d8d8d8;
@skipped: #d8d8d8;
@stop: #ff7043;
@not_audit: #f1b42d;

.pipelineManage_tree {
  flex-basis: 20%;
  border-right: 1px solid rgba(216, 216, 216, 1);
}

.c7ncd-pipelineManage {

  &-sidebar {
    z-index: 1;
    width: 100%;
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, .1);
    padding-top: .15rem;

    &-search {
      width: 100%;
      display: block;
      padding: 0 .1rem;

      .@{c7n-pro-prefix}-input-prefix {
        left: 0.08rem;

        .icon {
          font-size: .2rem;
        }
      }

      .@{c7n-pro-prefix}-input:not(textarea):not(:first-child) {
        padding-left: .32rem;
      }
    }

    .c7n-scrollbar-y {
      height: 93%;
    }

    &-tree {
      margin-top: .16rem;

      .@{c7n-prefix}-tree-treenode {
        width: 100%;
        padding: 0;

        &:last-child {
          margin-bottom: .1rem;
        }

        &:last-child,
        .@{c7n-prefix}-tree-node-content-wrapper-open {

          .c7ncd-pipelineManage-sidebar-header-parent {
            border-bottom: 1px solid rgba(216, 220, 235, 1);
          }
        }
      }

      .@{c7n-prefix}-tree-switcher {
        padding-top: .05rem;
      }

      .@{c7n-prefix}-tree-node-content-wrapper {
        width: 100%;
        padding: 0;
        overflow: hidden;
      }

      .@{c7n-prefix}-tree-treenode-selected {
        background: #f5f6fa;
        border-left: 4px solid #6887e8;

        .@{c7n-prefix}-tree-switcher {
          margin-left: -4px;
        }

        .c7ncd-pipelineManage-sidebar-header-node {
          background: #f5f6fa !important;
        }
      }

      .@{c7n-prefix}-tree-node-selected {
        background-color: transparent !important;
      }

      .@{c7n-prefix}-tree-indent {
        display: none;
      }

      .@{c7n-prefix}-tree-switcher-icon {
        font-size: .2rem;
      }
    }

    &-header {
      display: flex;
      align-items: center;
      line-height: .18rem;

      &-parent {
        padding: .08rem .04rem;
        border-top: 1px solid rgba(216, 220, 235, 1);
        border-image: linear-gradient(to right, rgba(216, 220, 235, 0.2), rgba(216, 220, 235)) 30 30;
      }

      &-node {
        display: flex;
        align-items: center;
        line-height: .18rem;
        padding: .05rem .04rem;

        &-more {
          background: #fff !important;
          cursor: default;

          &-text {
            color: #5266d4;
            cursor: pointer;
            font-size: .12px;
          }
        }
      }

      &:first-child {
        margin-bottom: .05rem;
      }
      &:last-child {
        margin-bottom: 0;
      }

      &-name {
        font-weight: 400;
        margin-left: .04rem;
        flex-grow: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        .c7ncd-treemenu-text {
          width: 100%;
        }
      }

      &-time {
        font-size: .12rem;
        color: rgba(58, 52, 95, 0.65);
      }

      &-active {
        width: .5rem;
        height: .2rem;
        line-height: .2rem;
        color: #fff;
        font-size: .12rem;
        font-weight: 500;
        text-align: center;
        transform: scale(0.8);
        margin-left: -.05rem;

        &-true {
          background: @success;
        }
        &-false {
          background: rgba(0, 0, 0, 0.2);
        }
      }

      &-service {
        color: rgba(0, 0, 0, 0.65);
      }

      &-status {
        transform: scale(0.8);
        margin-left: -.05rem;
      }

      &-icon {
        color: @canceled;
        margin-right: .13rem;

        &-success {
          color: @success;
        }
        &-running {
          color: @running;
        }
        &-pending {
          color: @pending;
        }
        &-failed {
          color: @failed;
        }
        &-stop {
          color: @stop;
        }
        &-not_audit {
          color: @not_audit;
        }
      }

      &-number {
        font-size: .12rem;
        color: #3a345f;
        max-width: .56rem;
        margin-right: .1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      &-stage {
        margin: 0 auto 0 0;

        &-item {
          width: .08rem;
          height: .08rem;
          display: inline-block;
          border-radius: 50%;
          background: @canceled;

          &-success {
            background: @success;
          }

          &-failed {
            background: @failed;
          }

          &-running {
            background: @running;
          }

          &-pending {
            background: @pending;
          }

          &-stop {
            background: @stop;
          }

          &-not_audit {
            background: @not_audit;
          }
        }

        &-line {
          width: .06rem;
          height: 1px;
          border-top: 1px solid #d3d3d3;
          display: inline-block;
          vertical-align: middle;
          margin: .02rem;

          &-manual {
            border-top: 1px dotted @not_audit;
          }

          &:first-child {
            display: none;
          }
        }
      }

      .c7ncd-pipelineManage-title-type {
        line-height: 13px !important;
      }
    }
  }

  &-title-type {
    flex-shrink: 0;
  }
}
